<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      window.onload = function () {
        let num = {
          name: "Zhangsan",
          age: 19,
          gender: "女",
        };
        // 1. 存储数据：setItem(名字,值) 存储的值是字符串，要加双引号！！
        sessionStorage.setItem("name", "张三");
        sessionStorage.setItem("namme", JSON.stringify(num));
      };
    </script>
  </body>
</html>
